package com.example.wastewater.controller;

import com.example.wastewater.common.convention.result.Result;
import com.example.wastewater.common.convention.result.Results;
import com.example.wastewater.dto.resp.WwPredictOneRespDTO;
import com.example.wastewater.dto.resp.WwRandomOneNoBODRespDTO;
import com.example.wastewater.service.IWasteWaterService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class WastewaterController {
    private final IWasteWaterService wasteWaterService;
    @GetMapping("/api/waste-water/admin/v1/water-data-no-BOD")
    private Result<WwRandomOneNoBODRespDTO> getRandomOneNoBOD(){
        return Results.success(wasteWaterService.getRandomOneNoBOD());
    }

//    @GetMapping("/api/waste-water/admin/v1/water-data-one")
//    private Result<WwOneRespDTP> getOneById(@Param("id") Long id){
//        return Results.success(wasteWaterService.getOne(id));
//    }

    @GetMapping("/api/waste-water/admin/v1/water-data-predit")
    private Result<List<WwPredictOneRespDTO>> getPreditData(@RequestParam(value = "count", defaultValue = "1") Integer count){
        return Results.success(wasteWaterService.getPreditData(count));
    }

    @GetMapping("/api/waste-water/admin/v1/water-data-report")
    private Result<String> getReport(@RequestParam("id") Long id){
        return Results.success(wasteWaterService.getReport(id));
    }
}
